
package com.ltu.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import lombok.RequiredArgsConstructor;
import springfox.documentation.annotations.ApiIgnore;

import com.ltu.model.request.base.BaseIdReq;
import com.ltu.model.response.base.CodeDataResp;
import com.ltu.service.MenuService;
import com.ltu.service.impl.BaseServiceImpl;
import com.ltu.model.request.base.PageReqData;
import org.springframework.web.bind.annotation.RestController;

import com.ltu.domain.mp_entity.Menu;
import com.ltu.mapper.MenuMapper;

import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <p>
 * 菜单表 前端控制器
 * </p>
 *
 * @author ruochen@cxmx123
 * @since 2021-10-08
 */
//@RestController
//@RequestMapping("/menu")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@ApiIgnore
public class MenuController extends BaseServiceImpl<MenuMapper, Menu>  {
    private final MenuService menuService;

    @ApiOperation(value="获取列表")
    @RequestMapping(value="/getList", method= RequestMethod.POST)
    public CodeDataResp getList(@RequestBody PageReqData pageReq) {
        return menuService.getList(pageReq);
    }

    @ApiOperation(value="新增/保存")
    @RequestMapping(value="/saveOrUpdate", method= RequestMethod.POST)
    public CodeDataResp saveOrUpdate(@RequestBody BaseIdReq req) {
        return menuService.saveOrUpdate(req);
    }

    @ApiOperation(value="获取详情")
    @RequestMapping(value="/getDetail", method= RequestMethod.POST)
    public CodeDataResp getDetail(@RequestBody BaseIdReq baseIdReq) {
        return menuService.getDetail(baseIdReq);
    }

    @ApiOperation(value="删除")
    @RequestMapping(value="/remove", method= RequestMethod.POST)
    public CodeDataResp remove(@RequestBody BaseIdReq baseIdReq) {
        return menuService.remove(baseIdReq);
    }

}

